package com.dao;

import com.mypg.*;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

public interface UserQuestionDao {

    List<UserQuestion> selectAllUserQuestion();
    int selectUserQuestion_count();
    UserQuestion selectUserQuestionByUserQuestion_id(@Param("user_id")int user_id ,@Param("question_id")int question_id);
    List<UserQuestion> selectUserQuestion_for_user_question_table_jsp(@Param("user_nickname")String user_nickname,
                                                      @Param("question_id")int question_id,
                                                      @Param("start_row")int start_row,@Param("page_nums")int page_nums);
    int selectUserQuestion_count_For_user_question_table_jsp(@Param("user_nickname")String user_nickname,
                                                  @Param("question_id")int question_id);
    int selectCountByFlag_pass_and_user_id(@Param("user_id")int user_id,@Param("flag_pass")int flag_pass,
                                           @Param("question_class")String question_class,@Param("question_chapter")String question_chapter);
    List<WrongChapter> selectWrongChapterByUser_id(@Param("user_id")int user_id,@Param("flag_pass")int flag_pass,
                                                   @Param("question_class")String question_class);
    List<Question> selectWrongQuestionByUser_id(@Param("user_id")int user_id,
                                                  @Param("question_class")String question_class,
                                                  @Param("question_chapter")String question_chapter,
                                                @Param("flag_pass")int flag_pass);
    List<UserRank> selectUserRank();


    void deleteUserQuestionByUserQuestion_id(@Param("user_id")int user_id ,@Param("question_id")int question_id);

    void insertUserQuestion(UserQuestion userQuestion);

    void updateFlag_passByUser_id_and_question_id(@Param("user_id")int user_id,@Param("question_id")int question_id,
                                                  @Param("flag_pass")int flag_pass);
    void updateUser_nicknameByUser_id(@Param("user_id")int user_id,@Param("user_nickname")String user_nickname);

}
